/*
 * Hyuga: A Density-Grid Stream Clustering Platform.
 * Copyright (C) 2014 PUC-Rio/Laboratory for Advanced Collaboration
 *
 * Hyuga is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Hyuga is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Hyuga.  If not, see <http://www.gnu.org/licenses/>.
 */
package br.pucrio.inf.lac.konoha.hyuga.events.semantics;

import br.pucrio.inf.lac.konoha.hyuga.events.cell.CellClusterEvent;
import br.pucrio.inf.lac.konoha.hyuga.events.grid.GridLogicalClusterEvent;

/**
 * Represent a new context partition (cell) clustering event that is not within any existing cluster, that is, all 
 * clusters do not contains this cell.
 * 
 * @author Marcos Roriz <mroriz@inf.puc-rio.br>
 */
public class NewCellClusterEvent {

    private CellClusterEvent cell;
    private GridLogicalClusterEvent cluster;
    
    /**
     * Empty Constructor
     */
    public NewCellClusterEvent() {}

    /**
     * Clustering Cell that forms the cluster.
     * @param cells
     */
    public NewCellClusterEvent(CellClusterEvent cell) {
        this.cell = cell;
    }
    
    /**
     * Clustering Cell that forms the cluster.
     * @param cells the cluster cell
     * @param the logical set of pair <x,y> that compose this cluster 
     */
    public NewCellClusterEvent(CellClusterEvent cell, GridLogicalClusterEvent logicalCluster) {
        this.cell = cell;
        this.cluster = logicalCluster;
    }

    //////////////////////////////////////////////////////////////////////////
    // Gets and Sets
    //////////////////////////////////////////////////////////////////////////

    public CellClusterEvent getCell() {
        return cell;
    }

    public void setCell(CellClusterEvent cell) {
        this.cell = cell;
    }
    
    public GridLogicalClusterEvent getCluster() {
        return cluster;
    }
    
    public void setCluster(GridLogicalClusterEvent cluster) {
        this.cluster = cluster;
    }
    
    @Override
    public String toString() {
        String strRepresentation = "";
        if (cell != null) {
            if (cell.getCore() != null) {
                strRepresentation = "DENSE CELL @ (" + cell.getCore().getX() + ", " + cell.getCore().getY() + ")";
            } else {
                strRepresentation = "DENSE CELL WITH NULL CORE";
            }
        }
        
        return strRepresentation;
    }
}
